'use strict';  
import React, { Component } from 'react';  
import {StyleSheet, View, Image, Text, TouchableOpacity} from 'react-native';
  
export default class LoadError extends Component {
  constructor(props) {  
    super(props);
  }
  render() {  
    return (
      <View style={[styles.container,this.props.style]}>
        <Image style={styles.loadImg} source={this.props.sourceIcon || require('../images/error.png')} />
        <Text style={styles.tipsText}>加载错误</Text>
        <Text style={styles.tipsText}>原因：{this.props.reason}</Text>
        <TouchableOpacity style={styles.tips} onPress={this.props.reload}>
          <Text style={styles.tipsText}>点击重新加载</Text>
        </TouchableOpacity>
      </View>
    )
  }
} 
const styles = StyleSheet.create({  
  container: {
    flex: 1,
    justifyContent: 'center',
    alignItems: 'center',
    backgroundColor: '#f6f6f6',
  },
  loadImg: {
    marginBottom: 10,
  },
  tips: {
    justifyContent: 'center',
    alignItems: 'center',
    borderBottomWidth:1,
    borderColor: '#5b5b5b'
  },
  tipsText: {
    lineHeight: 20,
    color: '#393939'
  }
});  